<?php
	//digunakan untuk kelas untuk permintaan yang tidak biasa
	class BIRD_MODEL extends CI_Model{
		/**
		*	@param Pigeon, 
		*	I:	intid_week,
		*	O:	query->result
		* 	Desc: untuk melihat laporan totalomset per-week dari seluruh cabang
		*/
		function Pigeon($week){
		
			/*
			$query = $this->db->query('SELECT *,
				(select sum(n.inttotal_omset) totalomset from nota n where n.intid_cabang = c.intid_cabang and n.intid_week = "$week") totalomset 
				from cabang c
				where c.intid_cabang !="" and c.intid_cabang != 1');
			return $query->result();
			/*
			select sum(n.inttotal_omset) from nota n where n.intid_cabang = c.intid_cabang  
			*/
			$query = $this->db->query('SELECT strnama_cabang,
				(select sum(n.inttotal_omset)as totalomset from nota n where n.intid_cabang = c.intid_cabang and n.intid_week = "'.$week.'") totalomset 
				from cabang c
				where c.intid_cabang !="" and c.intid_cabang != 1');
			return $query->result();
			
		}
	}
?>